﻿using System.Collections.Generic;
using UnityEditor;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [CustomPropertyDrawer(typeof(LevelServicePrefabDropdownAttribute))]
    public class LevelServicePrefabDropdown : PrefabDropdownDrawer
    {
    }
    
    public class LevelServicePrefabDropdownAttribute : PrefabDropdownAttribute
    {
        private int prefabType;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="prefabType">1服务2执行</param>
        public LevelServicePrefabDropdownAttribute(int prefabType)
        {
            this.prefabType = prefabType;
        }

        public override List<string> GetPrefabList()
        {
            return LevelServiceBlackboard.Instance.GetPrefabList(this.prefabType);
        }
        
        public override string GetPrefabGraphPath(string prefabKey)
        {
            return LevelServiceBlackboard.Instance.GetPrefabGraphPath(prefabKey, this.prefabType);
        }
    }
}